package jfinal;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;

import com.jfinal.core.JFinalFilter;


@SpringBootApplication
public class AppJfinal {
	public static void main(String args[]){
		SpringApplication.run(AppJfinal.class, args);
	}
	@Bean
	public FilterRegistrationBean jfFilterReg(){
		FilterRegistrationBean reg = new FilterRegistrationBean();
		reg.setFilter(new JFinalFilter());
		reg.addInitParameter("configClass", "jfinal.AppConfig");
		reg.addUrlPatterns("/*");
		return reg;
	}
}
